package com.bajie.bjlisten.sevice;


import com.bajie.bjlisten.mapper.BjUserRoleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;

@Service
@Transactional
public class BjUserRoleService {
    @Autowired
    BjUserRoleMapper bjUserRoleMapper;

    /**
     * 根据用户ID删除用户角色表
     *
     * @param userId
     * @return
     */
    public int deleteUserRole(String userId) {
        return bjUserRoleMapper.deleteUserRole(userId);
    }

    /**
     * 根据用户ID和角色保存用户角色表
     *
     * @param user_id
     * @param roleIds
     * @return
     */
    public int saveUserRoles(String user_id, List<String> roleIds) {
        return bjUserRoleMapper.saveUserRoles(user_id, roleIds);
    }

}
